package com.mango.ch12;

import com.aliyun.odps.data.Record;
import com.aliyun.odps.mapred.MapperBase;

import java.io.IOException;
import java.util.ArrayList;

public class ALKmeans {
    public static class ClusterMapper extends MapperBase {
        Record key;
        Record value;
        Long k;
        ArrayList<String> cluster = new ArrayList<>();
        long count = 0;

        @Override
        public void setup(TaskContext context) throws IOException {
            key = context.createMapOutputKeyRecord();
            value = context.createMapOutputValueRecord();
            context.getCounter("J", "J").setValue(-1);
        }

        @Override
        public void map(long key, Record record, TaskContext context) throws IOException {
            super.map(key, record, context);
        }
    }
}
